<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>EHS中国信息管理系统</title>
    <script type="text/javascript" src="__ROOT__/Public/Js/jquery-1.5.0.min.js"></script>
    <script type="text/javascript" src="__ROOT__/Public/Js/core.js"></script>
	<style>
	  table{border-collapse:collapse;border:none;line-height:16px;border:1px solid #ccc}
	  body{font-size:14px;}
	</style>
  </head>
  <body>
    <script>
      var data = [];
    </script>
    <div style="margin:0 auto; text-align:center; padding:10px;">
      <div style="padding:2px;">
        <layout name="Public:doc-header" cache="0" />
        <div style="width:80%; float:left;">
          <div>点击按钮，把以下的文档录入数据库<input type="button" onclick="clickInsert()" value="录入"/></div>
          <!--      <form action="__URL__/insert" id="formList" method="post"> -->
          <table width="100%" align="center" cellpadding="0" cellspacing="1" id="tblList" >
            <tr><th>序号</th><th>文件</th><th>大小</th></tr>
            <volist name="info['list']" id="l" key="i">
              <tr style="display:none"><td>
                  <script>
                    var index = "{$i}" - 1;
                    data[index] = {};
                    //data[index]['title'] = "{$l.title}";
                    data[index]['file_size'] = "{$l.file_size}";
                    data[index]['file_info'] = "{$l.title}";
                    data[index]['file_url'] = "{$l.file_url}";
                    data[index]['title'] = "{$l.title}";
                  </script>
                  <!--             <input type="hidden" name="{$i}__title" value="{$l.title}"/>
                               <input type="hidden" name="{$i}__file_size" value="{$l.file_size}"/>
                               <input type="hidden" name="{$i}__file_info" value="{$l.title}"/>
                               <input type="hidden" name="{$i}__file_url" value="{$l.file_url}"/>   -->
                </td></tr>
              <tr>
                <td>{$i}</td><td>{$l.file_url}</td><td>{$l.file_size}</td>
              </tr>
            </volist>
          </table>
          <!--     </form> -->
        </div>
      </div>
      {/*<layout name="Public:doc-footer" cache="0" /> */}
    </div>
    <script>
      var url = "__URL__";
      function clickInsert(){
        ajax.send(url+'/insert',{data:data},function(obj){
          debug(obj.data);
          $("#tblList").html('');
        });
      }
    </script>
  </body>
</html>
